package image;

import android.widget.ImageView;

/**
 * AfterTabInitializationCallback that is invoked with a success/failure after attempting to load a
 * drawable from an url. Note: If an ImageView has multiple setUrlDrawable calls made on it, only
 * the last callback will be invoked. This scenario arises when using ListViews which recycle their
 * views. This is done to prevent callbacks from being erroneosly invoked on ImageViews that are no
 * longer interested in the url that was loaded. To guarantee a callback is invoked, one can do the
 * following: First call loadUrlDrawable (with a callback), and then setUrlDrawable. Both loads just
 * get queued into the same request, so you don't need to worry about that being inefficient or that
 * it is making two network calls.
 *
 * @author koush
 */
public interface UrlImageViewCallback
{
    
    /**
     * @param imageView       ImageView for the load request.
     * @param url             The url that was loaded.
     * @param loadedFromCache This will indicate whether the load operation result came from cache, or
     *                        was retrieved.
     */
    void onLoaded(ImageView imageView, String url, boolean loadedFromCache); //Test me !
}
